package com.framework.model.module.user;

import com.framework.common.annotation.QueryParam;
import com.framework.common.model.validation.ValidationGroup;
import com.framework.common.util.other.NumeralUtil;
import com.framework.model.base.BaseModel;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * @author 龘鵺
 * @version 1.0
 * @className com.framework.model.module.user.Stratum
 * @title 用户层级类
 * @datetime 2024-05-14 09:59:18
 */
public class Stratum extends BaseModel implements Serializable {
    /**
     * 分佣规则编号 USER_REBATE_ID
     */
    @NotNull(message = "请选择分佣规则编号", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Min(message = "分佣规则编号不存在", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Max(message = "分佣规则编号不存在", value = Long.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "userRebateId", code = "p.USER_REBATE_ID")
    private Long userRebateId;

    /**
     * 固定值分佣 REBATE_AMOUNT
     */
    @NotNull(message = "请输入固定值分佣", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Digits(message = "固定值分佣最多6位数字或带有6位数字带2位小数", integer = 6, fraction = 2, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "rebateAmount", code = "p.REBATE_AMOUNT")
    private BigDecimal rebateAmount;

    /**
     * 一级编号(对应T_USER表的ID) NINE_ID
     */
    @NotNull(message = "请选择一级编号(对应T_USER表的ID)", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Min(message = "一级编号(对应T_USER表的ID)不存在", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Max(message = "一级编号(对应T_USER表的ID)不存在", value = Long.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "nineId", code = "p.NINE_ID")
    private Long nineId;

    /**
     * 二级编号(对应T_USER表的ID) TEN_ID
     */
    @NotNull(message = "请选择二级编号(对应T_USER表的ID)", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Min(message = "二级编号(对应T_USER表的ID)不存在", value = NumeralUtil.POSITIVE_ONE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Max(message = "二级编号(对应T_USER表的ID)不存在", value = Long.MAX_VALUE, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "tenId", code = "p.TEN_ID")
    private Long tenId;

    /**
     * 一级返利比例（待定，暂时不用） NINE_REBATE_RATIO
     */
    @NotNull(message = "请输入一级返利比例（待定，暂时不用）", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Digits(message = "一级返利比例（待定，暂时不用）最多5位数字或带有5位数字带2位小数", integer = 5, fraction = 2, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "nineRebateRatio", code = "p.NINE_REBATE_RATIO")
    private BigDecimal nineRebateRatio;

    /**
     * 二级返利比例 TEN_REBATE_RATIO
     */
    @NotNull(message = "请输入二级返利比例", groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @Digits(message = "二级返利比例最多5位数字或带有5位数字带2位小数", integer = 5, fraction = 2, groups = {ValidationGroup.formEdit.class, ValidationGroup.formAdd.class, ValidationGroup.formQuery.class})
    @QueryParam(name = "tenRebateRatio", code = "p.TEN_REBATE_RATIO")
    private BigDecimal tenRebateRatio;

    /**
     * t_stratum
     */
    private static final long serialVersionUID = 1L;

    public Long getUserRebateId() {
        return userRebateId;
    }

    public void setUserRebateId(Long userRebateId) {
        this.userRebateId = userRebateId;
    }

    public BigDecimal getRebateAmount() {
        return rebateAmount;
    }

    public void setRebateAmount(BigDecimal rebateAmount) {
        this.rebateAmount = rebateAmount;
    }

    public Long getNineId() {
        return nineId;
    }

    public void setNineId(Long nineId) {
        this.nineId = nineId;
    }

    public Long getTenId() {
        return tenId;
    }

    public void setTenId(Long tenId) {
        this.tenId = tenId;
    }

    public BigDecimal getNineRebateRatio() {
        return nineRebateRatio;
    }

    public void setNineRebateRatio(BigDecimal nineRebateRatio) {
        this.nineRebateRatio = nineRebateRatio;
    }

    public BigDecimal getTenRebateRatio() {
        return tenRebateRatio;
    }

    public void setTenRebateRatio(BigDecimal tenRebateRatio) {
        this.tenRebateRatio = tenRebateRatio;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userRebateId=").append(userRebateId);
        sb.append(", rebateAmount=").append(rebateAmount);
        sb.append(", nineId=").append(nineId);
        sb.append(", tenId=").append(tenId);
        sb.append(", nineRebateRatio=").append(nineRebateRatio);
        sb.append(", tenRebateRatio=").append(tenRebateRatio);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Stratum other = (Stratum) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCreateId() == null ? other.getCreateId() == null : this.getCreateId().equals(other.getCreateId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getOperaterId() == null ? other.getOperaterId() == null : this.getOperaterId().equals(other.getOperaterId()))
            && (this.getOperaterTime() == null ? other.getOperaterTime() == null : this.getOperaterTime().equals(other.getOperaterTime()))
            && (this.getUserRebateId() == null ? other.getUserRebateId() == null : this.getUserRebateId().equals(other.getUserRebateId()))
            && (this.getRebateAmount() == null ? other.getRebateAmount() == null : this.getRebateAmount().equals(other.getRebateAmount()))
            && (this.getNineId() == null ? other.getNineId() == null : this.getNineId().equals(other.getNineId()))
            && (this.getTenId() == null ? other.getTenId() == null : this.getTenId().equals(other.getTenId()))
            && (this.getNineRebateRatio() == null ? other.getNineRebateRatio() == null : this.getNineRebateRatio().equals(other.getNineRebateRatio()))
            && (this.getTenRebateRatio() == null ? other.getTenRebateRatio() == null : this.getTenRebateRatio().equals(other.getTenRebateRatio()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCreateId() == null) ? 0 : getCreateId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getOperaterId() == null) ? 0 : getOperaterId().hashCode());
        result = prime * result + ((getOperaterTime() == null) ? 0 : getOperaterTime().hashCode());
        result = prime * result + ((getUserRebateId() == null) ? 0 : getUserRebateId().hashCode());
        result = prime * result + ((getRebateAmount() == null) ? 0 : getRebateAmount().hashCode());
        result = prime * result + ((getNineId() == null) ? 0 : getNineId().hashCode());
        result = prime * result + ((getTenId() == null) ? 0 : getTenId().hashCode());
        result = prime * result + ((getNineRebateRatio() == null) ? 0 : getNineRebateRatio().hashCode());
        result = prime * result + ((getTenRebateRatio() == null) ? 0 : getTenRebateRatio().hashCode());
        return result;
    }
}